const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  productionSourceMap: false,
  lintOnSave: false,
  devServer: {
    open: true,
    headers: {
      'Access-Control-Allow-Origin': '*',
    },
    //这里的ip和端口是前端项目的;下面为需要跨域访问后端项目
    proxy: {
      '/api': {
        // target: 'http://192.168.31.213:4000',
        target: 'http://192.168.98.62:4000',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''//重写路径
        }
      },
      '/huaweiapi': {
        target: 'https://iam.cn-north-4.myhuaweicloud.com',//这里填入你要请求的接口的前缀
        changeOrigin: true,//虚拟的站点需要更管origin
        pathRewrite: {
          '^/huaweiapi': ''//重写路径
        }
      },
      '/admin': {
        target: 'https://www.example.com',//这里填入你要请求的接口的前缀
        changeOrigin: true,//虚拟的站点需要更管origin
        secure: true,
        pathRewrite: {
          '^/admin': ''//重写路径
        }
      }
    }
  }
})
// admin
